//
//  SKPlayerProgressView.m
//  ocDemo
//
//  Created by Joggy on 16/8/5.
//  Copyright © 2016年 Joggy. All rights reserved.
//

#import "SKPlayerProgressView.h"

@implementation SKPlayerProgressView

- (instancetype)init {
    self = [super initWithFrame:CGRectMake(0, screenHeight - 80, 320, 80)];
    self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];
    _slider = [[UISlider alloc] initWithFrame:CGRectMake(20, self.frame.size.height/4 - 15, self.frame.size.width - 40, 30)];
    _slider.tintColor = CUSTOM_GREEN;
    _slider.continuous = true;
    [self addSubview:_slider];
//    _bufferLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, self.frame.size.height/3 + 6, self.frame.size.width - 140, 44)];
//    _bufferLabel.textAlignment = NSTextAlignmentCenter;
//    _bufferLabel.text = @"default";
//    _bufferLabel.alpha = 0.6;
//    [self addSubview:_bufferLabel];
    _progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 88, 44)];
    _progressLabel.center = CGPointMake(self.frame.size.width/2 - 44, self.frame.size.height*2/3);
    _progressLabel.text = @"00:00";
    _progressLabel.textAlignment = NSTextAlignmentCenter;
    _progressLabel.alpha = 0.6;
    [self addSubview:_progressLabel];
    _durationLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 88, 44)];
    _durationLabel.center = CGPointMake(self.frame.size.width/2 + 44, self.frame.size.height*2/3);
    _durationLabel.text = @"00:00";
    _durationLabel.textAlignment = NSTextAlignmentCenter;
    _durationLabel.alpha = 0.6;
    [self addSubview:_durationLabel];
    
    _pauseButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _pauseButton.frame = CGRectMake(20, self.frame.size.height/3 + 6, 60, 44);
    [_pauseButton setTitle:@"暂停" forState:UIControlStateNormal];
    [_pauseButton setTitleColor:CUSTOM_GREEN forState:UIControlStateNormal];
    [_pauseButton setTitle:@"播放" forState:UIControlStateSelected];
    [_pauseButton setTitleColor:CUSTOM_GREEN forState:UIControlStateSelected];
    [_pauseButton setBackgroundColor:[UIColor clearColor]];
    [self addSubview:_pauseButton];
    _stopButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _stopButton.frame = CGRectMake(self.frame.size.width - 60 - 20, self.frame.size.height/3 + 6, 60, 44);
    [_stopButton setTitle:@"停止" forState:UIControlStateNormal];
    [_stopButton setTitleColor:CUSTOM_GREEN forState:UIControlStateNormal];
    [self addSubview:_stopButton];
    
    return self;
}

- (void)layoutSubviews {
    NSLog(@"layoutSubviews");
}

@end
